<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../Jquery/jquery-3.6.0.min.js"></script>
    <style>
        #shop{
            width: 300px;
            border: 1px solid;
        }
        #d{
            width: 300px;
            border:1px solid;


        }
    </style>
</head>

<body>
<input type="text" id="shop" onkeyup="fun2()" >
<div id="d"> </div>


<script>
    function fun2() {
        let val = $("#shop").val();
        $.ajax({
            url:"/s1",
            type:"get",
            data:{keyword:val},
            dataType:"json",
            success:function (result) {
                console.log(result);
                $("#d").html("");
                for (let i = 0;i<result.length;i++){
                 let prod = result[i];
                 let html = $("#d").html();
                 $("#d").html(html+prod.name+"<br/>")
                }
            }

        })


    }

</script>

</body>
</html>